#ZANDM 2017/3/6
from django.db import models

class Student(models.Model):
	student_id = models.CharField("学号",max_length=10,primary_key=True)
	user_name = models.CharField("姓名",max_length=30) 
	gender = models.CharField("性别",max_length=2)
	pwd = models.CharField(max_length=50)
	age = models.IntegerField("年龄")
	department = models.CharField("学院",max_length=40)
	class_admin = models.CharField("行政班级",max_length=40)
	class_room = models.CharField("课堂班级",max_length=200)

	def __str__(self):
		return '%s %s %s' % (self.student_id,self.user_name,self.class_admin)

class EvaluateAdmin(models.Model):
	id = models.CharField("工号",primary_key=True,max_length=10)
	pwd = models.CharField("工号",max_length=50)
	admin_type = models.CharField("管理员类型",max_length=50)

class CourseTimetable(models.Model):
	course_id = models.CharField("课程id",max_length=20,primary_key=True)
	teacher_id = models.CharField(max_length=10)
	name = models.CharField("名称",max_length=30)
	class_admin = models.CharField("班级",max_length=20)
	class_type = models.CharField("课程类型",max_length=20)

	def __str__(self):
	    return '%s %s %s' % (self.course_id,self.student_id,self.teacher_id)

class Teacher(models.Model):
	teacher_id = models.CharField(max_length=10,primary_key=True)
	user_name = models.CharField(max_length=30) 
	pwd = models.CharField(max_length=50)
	gender = models.CharField(max_length=2)
	age = models.IntegerField(null=True)
	department = models.CharField(max_length=40)
	teacher_title = models.CharField(max_length=40)
	def __str__(self):
		return '%s %s %s' % (self.teacher_id,self.user_name,self.department)

class ClassAdmin(models.Model):
	id = models.CharField(max_length=20,primary_key=True)
	name = models.CharField(max_length=80)

# 学生评价校园
class StudentEvaluateEnvironment(models.Model):
	student_id = models.CharField(max_length=10)
	totality = models.IntegerField("总体情况")
	teaching_environment = models.IntegerField("教学环境")
	accommodation_environment = models.IntegerField("住宿环境")
	diet_environment = models.IntegerField("饮食环境")
	teaching_environment_proposal = models.CharField("教学环境文字反馈",max_length=500)
	accommodation_environment_proposal = models.CharField("住宿环境文字反馈",max_length=500)
	diet_environment_proposal=models.CharField("饮食环境文字反馈",max_length=500)
	totality_proposal =  models.CharField("总体情况文字反馈",max_length=500)
	totality_h = models.CharField("热词",max_length=20)
	teaching_environment_h = models.CharField("热词",max_length=20)
	accommodation_environment_h = models.CharField("热词",max_length=20)
	diet_environment_h = models.CharField("热词",max_length=20)

	def __str__(self):
		return '%s %s %s' % (self.student_id,self.totality,self.teaching_environment)


# 学生评价教师
class StudentEvaluateTeacher(models.Model):
	student_id = models.CharField(max_length=10)
	teacher_id = models.CharField(max_length=10)
	class_id = models.CharField('课程id',max_length=10)
	class_mien = models.IntegerField("课堂风采")
	after_school_program = models.IntegerField("课后辅导")
	teacher_charm = models.IntegerField("人物魅力")
	proposal_of_teacher = models.CharField("对教师的文字反馈",max_length=500)
	hot_word_about_teacher = models.CharField("教师热词",max_length=50)



#学生评价校内机构
class StudentEvaluateOrganizaton(models.Model):
	student_id = models.CharField(max_length=10)
	organization = models.CharField('评价的机构',max_length=20)
	proposal = models.CharField('文字内容',max_length=500)
	hot_word = models.CharField('热词',max_length=50)



# 教师评价班级
class TeacherEvaluateClass(models.Model):
	teacher_id = models.CharField(max_length=10)
	course_class = models.CharField("课堂班级",max_length=40)
	classroom_discipline = models.IntegerField("课堂纪律")
	homework_quality = models.IntegerField("作业情况")
	study_atmosphere = models.IntegerField("学习氛围")
	student_potential = models.IntegerField("学生潜力")
	proposal_of_class = models.CharField("对班级的文字反馈",max_length=500)
	hot_word_about_class = models.CharField("教师热词",max_length=50)


#教师对机构表
class TeacherEvaluateOrganization(models.Model):
	teaching_program = models.CharField(max_length=1000)
	organization = models.CharField('评价的机构',max_length=20)
	organization_advice = models.CharField('评价机构的内容',max_length=600)

#学生评价校园汇总表
class StuentEnvironment(models.Model):
	year_term = models.CharField('学期',max_length=50)
	environment_type = models.CharField('评价方面',max_length=20)
	start1 =  models.IntegerField("很不满意")
	start2 =  models.IntegerField("不满意")
	start3 =  models.IntegerField("一般")
	start4 =  models.IntegerField("满意")
	start5 =  models.IntegerField("很满意")



#推送学生热词
class StudentHot(models.Model):
	year_term = models.CharField('学期',max_length=50)
	environment_type = models.CharField('类型',max_length=20)
	word = models.CharField('热词串(+相隔)',max_length=700)
	value = models.CharField('热词串(,相隔)',max_length=700)

#推送学生校园建议
class StudentEnvironmentAdvice(models.Model):
	year_term = models.CharField('学期',max_length=50)
	environment_type = models.CharField('学期',max_length=20)
	advice =models.CharField('意见(#，分隔)',max_length=4000)

#学生评价校内机构汇总表
class StudentEnvironmentOrganization(models.Model):
	year_term = models.CharField('学期',max_length=50)
	org_1 = models.IntegerField("教务处")
	org_2 = models.IntegerField("保卫处")
	org_3 = models.IntegerField("财务处")
	org_4 = models.IntegerField("校团委")
	org_5 = models.IntegerField("后勤基建处")
	org_6 = models.IntegerField("发展规划处")


#教师补充评价汇总表
class TeacherEnvironmentOrganization(models.Model):
	year_term = models.CharField('学期',max_length=50)
	org_1 = models.IntegerField("教务处")
	org_2 = models.IntegerField("保卫处")
	org_3 = models.IntegerField("财务处")
	org_4 = models.IntegerField("校团委")
	org_5 = models.IntegerField("后勤基建处")
	org_6 = models.IntegerField("发展规划处")


#记录评价系统开放
class Function(models.Model):	
	year_term = models.CharField('学期',max_length=50)
	state = models.CharField('开启状态',max_length=6)

#记录学生评价教师的ahp权重
class StudentAhp(models.Model):
	bad =  models.FloatField('差：分数0-59')
	conformity =  models.FloatField('合格：分数60-74')
	good =  models.FloatField('良：分数75-89')
	excellent =  models.FloatField('优秀：分数90-100')

#获取的学生成绩
class StudentGrade(models.Model):
	student_id = models.CharField("学号",max_length=10)
	teacher_id = models.CharField("工号",max_length=10)
	course_id = models.CharField("课程编号",max_length=10)
	grade = models.IntegerField("成绩")

#教师课程所得评分
class CountTeacher(models.Model):
	year_term = models.CharField('学期',max_length=50)
	teacher_id = models.CharField("工号",max_length=10)
	course = models.CharField("课程名称",max_length=50)
	class_type = models.CharField("课程类型",max_length=20)
	conformity = models.FloatField("及格率")
	excellent = models.FloatField("优秀率")
	grade = models.IntegerField("ahp得分")

#参与人数统计
class PeopleCount(models.Model):
	year_term = models.CharField('学期',max_length=50)
	teacher = models.IntegerField("参与教师数量")
	student = models.IntegerField("参与学生数量")
	hot_word = models.IntegerField("热词数量")
	advice = models.IntegerField("意见数量")
	teacher_percent =models.FloatField("教师参与率")
	student_percent =models.FloatField("学生参与率")

#对机构的热点意见
class OrganizationHot(models.Model):
	year_term = models.CharField('学期',max_length=50)
	organization = models.CharField('机构',max_length=30)
	word = models.CharField('热词串(+相隔)',max_length=700)
	advice =models.CharField('意见(#，分隔)',max_length=4000)